package bean;

import java.util.List;

public class MyClass {
    private String name = "Class 1";
    private List<Student> students;

    public List<Student> getStudentList() {
        return students;
    }

    public void setStudentList(List<Student> studentList) {
        this.students = studentList;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Class{\n");
        sb.append("  name='").append(name).append("',\n");
        sb.append("  studentList=\n");
        for (Student student : students) {
            sb.append("    ").append(student).append("\n");
        }
        sb.append('}');
        return sb.toString();
    }
}
